<p>testcomponent works! ---练习</p>

<input [(ngModel)]="eventInput" placeholder="请输入事项">
<button (click)="addEvent()">添加事项</button>

<div *ngIf="evenlist.length == 0; else divfor">暂无待办事项</div>
<ng-template #divfor>
<!-- <div *ngFor="let item of evenlist; let i = index"> -->
  <div *ngFor="let item of evenlist; index as i">
    <span>{{i+1}}. {{item}}</span>
    <button (click)="deleteEvent(i)">删除</button>
  </div>
</ng-template>
<br>


<hr>